home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / librw / RWSet.z / RWSet
Encoding:
Text File  |  1998-10-30  |  12.5 KB  |  331 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))                                                        RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWSet - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               typedef RWSet Set;   // Smalltalk typedef.
  13.           #include <rw/rwset.h>
  14.           RWSet h;
  15.  
  16.  
  17.  
  18.  
  19. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  20.      Class RRRRWWWWSSSSeeeetttt represents a group of unordered elements, not accessible by
  21.      an external key, where duplicates are not allowed.  It corresponds to the
  22.      Smalltalk class SSSSeeeetttt.  An object stored by RRRRWWWWSSSSeeeetttt must inherit abstract
  23.      base class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee, with suitable definition for virtual functions
  24.      hhhhaaaasssshhhh(((()))) and iiiissssEEEEqqqquuuuaaaallll(((()))) (see class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee).  The function hhhhaaaasssshhhh(((()))) is
  25.      used to find objects with the same hash value, then iiiissssEEEEqqqquuuuaaaallll(((()))) is used to
  26.      confirm the match. An item cccc is considered to be "already in the
  27.      collection" if there is a member of the collection with the same has
  28.      value as cccc for which iiiissssEEEEqqqquuuuaaaallll((((cccc)))) returns TTTTRRRRUUUUEEEE.  In this case, method
  29.      iiiinnnnsssseeeerrrrtttt((((cccc)))) will not add it, thus insuring that there are no duplicates.
  30.      The iterator for this class is RRRRWWWWSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr.
  31.  
  32. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  33.      Polymorphic
  34.  
  35. PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
  36.               RRRRWWWWSSSSeeeetttt (size_t n = RWDEFAULT_CAPACITY);
  37.  
  38.  
  39.      Constructs an empty set with nnnn hashing buckets.
  40.  
  41.               RRRRWWWWSSSSeeeetttt (const RWSet & h);
  42.  
  43.  
  44.      Copy constructor.  Makes a shallow copy of the collection hhhh.
  45.  
  46.               virtual ~~~~RRRRWWWWSSSSeeeetttt();
  47.  
  48.  
  49.      Calls cccclllleeeeaaaarrrr(((()))).
  50.  
  51. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr OOOOppppeeeerrrraaaattttoooorrrrssss
  52.               void
  53.           ooooppppeeeerrrraaaattttoooorrrr====(const RWSet& h);
  54.  
  55.  
  56.      Assignment operator.  Makes a shallow copy of the collection hhhh.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))                                                        RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74.               RWBoolean
  75.           ooooppppeeeerrrraaaattttoooorrrr========(const RWSet& h);
  76.  
  77.  
  78.      Returns TTTTRRRRUUUUEEEE if self and hhhh have the same number of elements and if for
  79.      every key in self there is a corresponding key in hhhh which iiiissssEEEEqqqquuuuaaaallll.
  80.  
  81.               RWBoolean
  82.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWSet& h);
  83.  
  84.  
  85.      Returns the negation of ooooppppeeeerrrraaaattttoooorrrr========(((()))), above.
  86.  
  87.               RWBoolean
  88.           ooooppppeeeerrrraaaattttoooorrrr<<<<====(const RWSet& h);
  89.  
  90.  
  91.      Returns TTTTRRRRUUUUEEEE  if self is a subset of hhhh, that is, every element of self
  92.      has a counterpart in hhhh which iiiissssEEEEqqqquuuuaaaallll.  NNNNooootttteeee:  If you inherit from RRRRWWWWSSSSeeeetttt
  93.      in the presence of the C++ Standard Library, we recommend that you
  94.      override this operator and explicitly forward the call.  Overload
  95.      resolution in C++ will choose the Standard Library provided global
  96.      operators over inherited class members.  These global definitions are not
  97.      appropriate for set-like partial orderings.
  98.  
  99.               RWBoolean
  100.           ooooppppeeeerrrraaaattttoooorrrr<<<<(const RWSet& h);
  101.  
  102.  
  103.      Returns TTTTRRRRUUUUEEEE  if self is a proper subset of hhhh, that is, every element of
  104.      self has a counterpart in hhhh which iiiissssEEEEqqqquuuuaaaallll, but where the two sets are not
  105.      identical.
  106.  
  107.               RWSet&
  108.           ooooppppeeeerrrraaaattttoooorrrr****====(const RWSet& h);
  109.  
  110.  
  111.      Sets self to be the intersection of self and hhhh.  Returns self.
  112.  
  113. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  114.               virtual void
  115.           aaaappppppppllllyyyy(RWapplyCollectable ap, void*);
  116.  
  117.  
  118.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn to apply the user-supplied function
  119.      pointed to by aaaapppp to each member of the collection in a (generally)
  120.      unpredictable order.  This supplied function must not do anything to the
  121.      items that could change the ordering of the collection.
  122.  
  123.               virtual RWspace
  124.           bbbbiiiinnnnaaaarrrryyyySSSSttttoooorrrreeeeSSSSiiiizzzzeeee() const;
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))                                                        RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))
  137.  
  138.  
  139.  
  140.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  141.  
  142.               virtual void
  143.           cccclllleeeeaaaarrrr();
  144.  
  145.  
  146.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  147.  
  148.               virtual void
  149.           cccclllleeeeaaaarrrrAAAAnnnnddddDDDDeeeessssttttrrrrooooyyyy();
  150.  
  151.  
  152.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  153.  
  154.               virtual int
  155.           ccccoooommmmppppaaaarrrreeeeTTTToooo(const RWCollectable* a) const;
  156.  
  157.  
  158.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee.
  159.  
  160.               virtual RWBoolean
  161.           ccccoooonnnnttttaaaaiiiinnnnssss(const RWCollectable* target) const;
  162.  
  163.  
  164.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  165.  
  166.               virtual size_t
  167.           eeeennnnttttrrrriiiieeeessss() const;
  168.  
  169.  
  170.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  171.  
  172.               virtual RWCollectable*
  173.           ffffiiiinnnndddd(const RWCollectable* target) const;
  174.  
  175.  
  176.      Returns the item in self which iiiissssEEEEqqqquuuuaaaallll to the item pointed to by ttttaaaarrrrggggeeeetttt
  177.      or nnnniiiillll if no item is found.  Hashing is used to narrow the search.
  178.  
  179.               virtual unsigned
  180.           hhhhaaaasssshhhh() const;
  181.  
  182.  
  183.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee.
  184.  
  185.               virtual RWCollectable*
  186.           iiiinnnnsssseeeerrrrtttt(RWCollectable* c);
  187.  
  188.  
  189.      Adds cccc to the collection and returns it.  If an item is already in the
  190.      collection which iiiissssEEEEqqqquuuuaaaallll to cccc, then the old item is returned and the new
  191.      item is not inserted.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))                                                        RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))
  203.  
  204.  
  205.  
  206.               virtual RWClassID
  207.           iiiissssAAAA() const;
  208.  
  209.  
  210.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee to return ________RRRRWWWWSSSSEEEETTTT.
  211.  
  212.               virtual RWBoolean
  213.           iiiissssEEEEmmmmppppttttyyyy() const;
  214.  
  215.  
  216.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee.
  217.  
  218.               virtual RWBoolean
  219.           iiiissssEEEEqqqquuuuaaaallll(const RWCollectable* a) const;
  220.  
  221.  
  222.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  223.  
  224.               void
  225.           iiiinnnntttteeeerrrrsssseeeeccccttttWWWWiiiitttthhhh(const RWSet& h, RWSet& ret) const;
  226.  
  227.  
  228.      Computes the intersection of self and h, and inserts the result into rrrreeeetttt
  229.      (which may be either empty or not, depending on the effect desired). It
  230.      may be slightly more efficient than ooooppppeeeerrrraaaattttoooorrrr****====(((()))).
  231.  
  232.               virtual size_t
  233.           ooooccccccccuuuurrrrrrrreeeennnncccceeeessssOOOOffff(const RWCollectable* target) const;
  234.  
  235.  
  236.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.  Returns the count of entries that
  237.      iiiissssEEEEqqqquuuuaaaallll to the item pointed to by target.  Because duplicates are not
  238.      allowed for this collection, only 0 or 1 can be returned.
  239.  
  240.               virtual RWCollectable*
  241.           rrrreeeemmmmoooovvvveeee(const RWCollectable* target);
  242.  
  243.  
  244.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.  Returns and removes the item that
  245.      iiiissssEEEEqqqquuuuaaaallll to the item pointed to by target, or nnnniiiillll if there is no item.
  246.  
  247.               virtual void
  248.           rrrreeeemmmmoooovvvveeeeAAAAnnnnddddDDDDeeeessssttttrrrrooooyyyy(const RWCollectable* target);
  249.  
  250.  
  251.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  252.  
  253.               void
  254.           rrrreeeessssiiiizzzzeeee(size_t n = 0);
  255.  
  256.  
  257.      Resizes the internal hashing table to leave nnnn slots.  If nnnn========0000, resizes to
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))                                                        RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++))))
  269.  
  270.  
  271.  
  272.      3333****eeeennnnttttrrrriiiieeeessss(((())))////2222.
  273.  
  274.               virtual void
  275.           rrrreeeessssttttoooorrrreeeeGGGGuuuuttttssss(RWvistream&);
  276.           virtual void
  277.           rrrreeeessssttttoooorrrreeeeGGGGuuuuttttssss(RWFile&);
  278.           virtual void
  279.           ssssaaaavvvveeeeGGGGuuuuttttssss(RWvostream&) const;
  280.           virtual void
  281.           ssssaaaavvvveeeeGGGGuuuuttttssss(RWFile&) const;
  282.  
  283.  
  284.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  285.  
  286.               RWStringID
  287.           ssssttttrrrriiiinnnnggggIIIIDDDD();
  288.  
  289.  
  290.      (acts virtual) Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee.
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.